package online.inote.naruto.api.access.sample.controller;

import lombok.extern.log4j.Log4j2;
import online.inote.naruto.api.access.annotation.ApiAccess;
import online.inote.naruto.common.utils.response.ExtendResponse;
import online.inote.naruto.common.utils.response.Response;
import org.springframework.web.bind.annotation.*;

/**
 * @description 示例Controller
 * @author XQF.Sui
 * @date 2021/07/30 19:09
 */
@Log4j2
@RestController
@RequestMapping(value = "demo")
public class DemoController {

  @ApiAccess
  @GetMapping(value = "get")
  public Response<Object> get() {
    log.info("Hello Naruto!");
    return ExtendResponse.success();
  }

  @ApiAccess
  @PostMapping(value = "save")
  public Response<Object> save(@RequestBody String data) {
    log.info(data);
    return ExtendResponse.success();
  }
}
